package com.beiding.workordersystem.orders.generalorder.controller;

import com.beiding.workordersystem.common.standard.R;
import com.beiding.workordersystem.orders.generalorder.service.GeneralOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/generalOrder/common")
public class CommonController {

    @Autowired
    private GeneralOrderService generalOrderService;

    @GetMapping("/details")
    @PreAuthorize("hasAnyAuthority('generalOrder_get')")
    R details(@RequestParam String id) {
        return R.ok(generalOrderService.getDetails(id));
    }

}
